<script src="/kissy/build/seed.js"></script>
<script>
    var S = KISSY;
    (function () {
        function xhr(url, success) {
            var req = new XMLHttpRequest();
            req.open('get', url, true);
            req.onload = function () {
                success(req.responseText);
            };
            req.send();
        }

        KISSY.config('loadModsFn', function (rs, config) {
            var fullpath = rs.fullpath, code;
            if (code = localStorage.getItem(fullpath)) {
                eval(code);
                config.success();
            } else {
                xhr(fullpath, function (code) {
                        try{
                    localStorage.setItem(fullpath, code);
                    }catch (e){
                        // QUOTA_EXCEEDED_ERR
                        KISSY.log(e,'error');
                    }
                    eval(code);
                    config.success();
                });
            }
        });
    })();

    S.config('packages', {
        test: {
            base: './',
            ignorePackageNameInUri: true
        }
    });
    var start = S.now();
    S.use('test/t', function (S, t) {
        alert('load ' + t + ' in ' + (S.now() - start) + ' ms');
    });
</script>